import cn.weiyang.biz.*;
import cn.weiyang.entity.District;
import cn.weiyang.entity.House;
import cn.weiyang.entity.Street;
import cn.weiyang.entity.Types;
import org.junit.Test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/7/8.
 */
public class Demo {
    @Test
    public void test1(){
        HouseBiz hb=new HouseBizImpl();
        Map map=new HashMap();
        map.put("pageSize",2);
        map.put("currPage",2);
        List<House> houses=hb.queryHouse(map);
        for(House house:houses){
            System.out.println(house.getHid()+house.getTypes().getTname()+house.getStreet().getSname()+house.getStreet().getDistrict().getDname());
        }
    }
    @Test
    public void test2(){
        TypesBiz tb=new TypesBizImpl();
        List<Types> types=tb.queryTypes();
        for (Types t:
             types) {
            System.out.println(t.getTname());
        }
    }
    @Test
    public void test3(){
        StreetBiz sb=new StreetBizImpl();
        List<Street> streets=sb.queryStreet(1);
        for(Street s:streets){
            System.out.println(s.getSname());
        }
    }
    @Test
    public void test4(){
        DistrictBiz db=new DistrictBizImpl();
        List<District> districts=db.queryDistrict();
        for (District d:
             districts) {
            System.out.println(d.getDname());
        }
    }
}
